package com.song.controller;

import com.song.pojo.User;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;

/**
 * @Author 宋伟宁
 * @Date 2024/1/3
 * @Version 1.0
 **/
@RestController
@RequestMapping("/product")
public class ProductController {

    @Value("${server.port}")
    private String port;

    @RequestMapping(value = "/",method = RequestMethod.GET)
    public String index(){
        return this.port+"产品服务！";
    }

    @PostMapping("/add")
    public String add(@RequestBody User user){
        System.out.println( user);
        return "添加成功！";
    }
}
